<?php
class Poll_Widget_FriendsQuestionsController extends Engine_Content_Widget_Abstract
{ 
    public function indexAction() {        
        $viewer = Engine_Api::_()->user()->getViewer();
        if (!$viewer->getIdentity()) return $this->setNoRender(true);
        $params['privacy'] = 'friends';
        $params['viewer'] = $viewer->getIdentity();
        $this->view->paginator = $paginator = Engine_Api::_()->poll()->pollPaginator($params);
        $paginator->setItemCountPerPage(5);
        if (!count($paginator)) return $this->setNoRender(true);
    }
}
